package com.bykj.property.mapper.provider;

import com.bykj.property.controller.vo.request.RepairOrderPageRequest;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.SQL;

/**
 * @author yiming
 * @title: RepairOrderSql
 * @projectName property
 * @description: TODO
 * @date 2019/6/3017:39
 */
public class RepairOrderSql {
    public String getSql(RepairOrderPageRequest pageRequest){
        return new SQL() {
            {
                SELECT("*");
                FROM("repair_order");

                if(pageRequest.getPmProprietorId()!=null) {
                    WHERE("pm_proprietor_id = #{pmProprietorId}");
                }
                if(StringUtils.isEmpty(pageRequest.getPhone())) {
                    WHERE("phone = #{phone}");
                }


            }


        }.toString();

    }
}
